import random


def greaterOrLess(n): #比大小
    if n > 10:
        return 1
    else:
        return 0
def guessNumber(a,b): # 猜数字
    for i in range(3):
        if a[i] != b[i]:
            return 0
    else:
        return 1

credit = 100

while credit > 0:
    gametype = int(input('1.猜大小还是2.猜数字：'))
    if gametype == 1:
        rolldice = [random.randint(1, 6), random.randint(1, 6), random.randint(1, 6)]
        dices = sum(rolldice)
        pChoice = int(input('买1.大还是0.小：'))
        while pChoice != 0 and pChoice != 1:
            pChoice = int(input('输错了，你到底买1.大还是0.小：'))
        pTolken = int(input('压多少：'))
        while pTolken > credit:
            print('你没有那么多点数')
            pTolken = int(input('压多少：'))
        if pChoice == greaterOrLess(dices):
            credit += pTolken
            print('你赢了')
        else:
            credit -= pTolken
            print('你输了')
        print('骰子显示点数：', rolldice,'点数总和：', dices)
        print(f'你还有{credit}点数')
        gametype = int(input('还玩吗？1.猜大小还是2.猜数字：'))
    elif gametype == 2:
       guess = input('你猜骰子的三个点是什么？ ')
       pTolken = int(input('压多少：'))
       while pTolken > credit:
           print('你没有那么多点数')
           pTolken = int(input('压多少：'))
       rolldice = [random.randint(1, 6), random.randint(1, 6), random.randint(1, 6)]
       if guessNumber(rolldice,guess) == 1:
           credit = credit + pTolken*10
           print('扔出来的骰子显示',rolldice)
           print("你赢了，你现在有",credit,'点')
       else:
           credit -= pTolken
           print('扔出来的骰子显示',rolldice)
           print('你输了','你还有',credit,'点')
    else:
        print('不玩了')
        break